<?php 
class configs{
		private $iniFile;
				
		public function getConfigs(){
			$this->setIniFile();
			$ini = parse_ini_file($this->iniFile);
			return $ini;
		}
		private function setIniFile(){
			if(file_exists("../config.ini")){
				$this->iniFile = "../config.ini";
			}
			elseif(file_exists("config.ini")){
				$this->iniFile = "config.ini";
			}else{
				echo "Arquivo de configurações inválido";
				exit;
			}
		}
		private function toObj($array){
			$object = new stdClass();
			foreach ($array as $key => $value){
				$object->$key = $value;
			}
			return $object;
		}
}
?>